// Author: wsfuyibing <682805@qq.com>
// Date: 2025-05-23

package get

import (
	"server/app/http/models"
	"server/app/kind"
)

// Response
// 出参.
type Response struct {
	MemberEarlyEnabled     kind.Enabled
	MemberEarlyEnabledText string
	MemberEarlyEnabledYes  bool
	MemberEarlyHours       int

	MemberReturnEnabled     kind.Enabled
	MemberReturnEnabledText string
	MemberReturnEnabledYes  bool
	MemberReturnWithCount   float64
	MemberReturnWithWeight  float64

	MemberTicketEnabled          kind.Enabled
	MemberTicketEnabledText      string
	MemberTicketEnabledYes       bool
	MemberTicketDiscountType     kind.DiscountType
	MemberTicketDiscountTypeText string
	MemberTicketDiscountAmount   float64

	MemberGoodsEnabled          kind.Enabled
	MemberGoodsEnabledText      string
	MemberGoodsEnabledYes       bool
	MemberGoodsDiscountType     kind.DiscountType
	MemberGoodsDiscountTypeText string
	MemberGoodsDiscountAmount   float64
}

func (o *Response) With(m *models.ArcadeSetting) *Response {
	o.MemberEarlyEnabled = m.MemberEarlyEnabled
	o.MemberEarlyEnabledText = o.MemberEarlyEnabled.Text()
	o.MemberEarlyEnabledYes = o.MemberEarlyEnabled.IsYes()
	o.MemberEarlyHours = m.MemberEarlyHours

	o.MemberReturnEnabled = m.MemberReturnEnabled
	o.MemberReturnEnabledText = o.MemberReturnEnabled.Text()
	o.MemberReturnEnabledYes = o.MemberReturnEnabled.IsYes()
	o.MemberReturnWithCount = m.MemberReturnWithCount
	o.MemberReturnWithWeight = m.MemberReturnWithWeight

	o.MemberTicketEnabled = m.MemberTicketEnabled
	o.MemberTicketEnabledText = m.MemberTicketEnabled.Text()
	o.MemberTicketEnabledYes = o.MemberTicketEnabled.IsYes()
	o.MemberTicketDiscountType = m.MemberTicketDiscountType
	o.MemberTicketDiscountTypeText = m.MemberTicketDiscountType.Text()
	o.MemberTicketDiscountAmount = m.MemberTicketDiscountAmount

	o.MemberGoodsEnabled = m.MemberGoodsEnabled
	o.MemberGoodsEnabledText = o.MemberGoodsEnabled.Text()
	o.MemberGoodsEnabledYes = o.MemberGoodsEnabled.IsYes()
	o.MemberGoodsDiscountType = m.MemberGoodsDiscountType
	o.MemberGoodsDiscountTypeText = o.MemberGoodsDiscountType.Text()
	o.MemberGoodsDiscountAmount = m.MemberGoodsDiscountAmount
	return o
}
